package com.alan.shiro.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @Auther: Alan liu
 * @Date: 2018/10/31 11:21
 * @Description: WebConfig
 */
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {

    /**
     * 1.X 和 2.X 静态资源访问方式变了，1.X 是默认 static 目录，但是 2.X 需要显示去说明。
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
    }
}
